Skip to content

[Spark-20775][SQL] Added scala support from_json#18094

Closed
rubenljanssen wants to merge 3 commits intoapache:masterfrom
rubenljanssen:spark-20775
Closed

[Spark-20775][SQL] Added scala support from_json#18094
rubenljanssen wants to merge 3 commits intoapache:masterfrom
rubenljanssen:spark-20775

Conversation

@rubenljanssen
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

from_json function required to take in a java.util.Hashmap. For other functions, a java wrapper is provided which casts a java hashmap to a scala map. Only a java function is provided in this case, forcing scala users to pass in a java.util.Hashmap.

Added the missing wrapper.

How was this patch tested?

Added a unit test for passing in a scala map

Copy link
Copy Markdown
Member

@ueshin ueshin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for minor comments.
cc @cloud-fan @gatorsmile


/**
* Parses a column containing a JSON string into a `StructType` or `ArrayType` of `StructType`s
* (Java-specific) Parses a column containing a JSON string into a `StructType` or `ArrayType` of `StructType`s
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: ScalaStyle check will fail saying File line length exceeds 100 characters.

}

/**
* (Scala-specific) Parses a column containing a JSON string into a `StructType` or `ArrayType` of `StructType`s
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

* format is also supported for the schema.
*
* @group collection_funcs
* @since 2.1.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@since 2.3.0?

@cloud-fan
Copy link
Copy Markdown
Contributor

ok to test

@SparkQA
Copy link
Copy Markdown

SparkQA commented May 25, 2017

Test build #77379 has finished for PR 18094 at commit a2f99ec.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link
Copy Markdown

SparkQA commented May 25, 2017

Test build #77381 has finished for PR 18094 at commit 27a8c26.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Copy Markdown
Contributor

thanks, merging to master!

@asfgit asfgit closed this in 2dbe0c5 May 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants